package com.ruoyi.project.domain.dto;

import cn.hutool.core.bean.BeanUtil;
import com.ruoyi.project.domain.entity.Canshu;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * (Canshu)表DTO层
 *
 * @author makejava
 * @since 2025-06-29 16:17:34
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class CanshuDTO extends Canshu {

    private static final long serialVersionUID = 1L;

    private String keyword;

    public boolean isNew() {
        return this.getId() == null;
    }

    public static CanshuDTO of(Canshu data) {
        CanshuDTO dto = new CanshuDTO();
        BeanUtil.copyProperties(data, dto);
        return dto;
    }

    public static CanshuDTO buildStatus(Boolean status) {
        CanshuDTO dto = new CanshuDTO();
        dto.setStatus(status);
        return dto;
    }
}
